package io.github.talelin.latticy.controller.v1;

import io.github.talelin.latticy.feign.UserWareFeignService;
import io.github.talelin.latticy.vo.WarehouseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.Positive;
import java.util.List;

/**
 * @program: latticy
 * @description: oms用户关联仓库接口
 * @author: mrxiao
 * @create: 2022-06-13 17:54
 */
@RestController
@RequestMapping("/v1/userWare")
public class UserWareController {

    @Autowired
    private UserWareFeignService userWareFeignService;

    /**
     * 远程调用wms端获取oms用户关联仓库接口
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    public List<WarehouseVO> getOmsWarehouseById(@PathVariable(value = "id") @Positive(message = "{id.positive}") Integer id) {
        return userWareFeignService.getWareNameListByOmsUserId(id);
    }
}
